package cn.lopr.im.api.service;

import cn.lopr.im.api.bean.Article;
import cn.lopr.im.api.bean.ArticleComment;
import cn.lopr.im.api.bean.ArticleOption;
import cn.lopr.im.api.bean.ArticlePlate;
import com.github.pagehelper.PageInfo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author shuangyang7
 * @date 2021/5/22 12:39
 */
@Transactional
public interface ICommunityDBService {
    List<ArticleOption> selectArticleOptionByRecord(ArticleOption articleOption);

    int addArticleOption(ArticleOption articleOption);

    void updateArticleOptionByRecord(ArticleOption articleOption);

    PageInfo<Article> selectArticleByPageAndPlateID(String plateID, int page, int size);

    PageInfo<Article> selectArticleByPageAndUserId(String publishUserId, int page, int size);

    List<Article> selectArticleByRecord(Article article);

    int updateArticleByRecord(Article article);

    int delArticleByID(Article article);

    int addArticleByRecord(Article article);

    List<ArticlePlate> selectPlate();

    List<ArticleComment> selectArticleCommentBySelective(ArticleComment articleComment);

    List<ArticleComment> selectArticleCommentByArticleIdAndPage(String articleId, int page, int size);

    List<ArticleComment> selectArticleCommentByCommentParentId(String parentId, int page, int size);

    Integer countArticleCommentByParentId(String parentId);

    int addArticleCommentBySelective(ArticleComment articleComment);

    int updateArticleCommentBySelective(ArticleComment articleComment);

    int delArticleCommentBySelective(ArticleComment articleComment);

    int countArticleLikeByUserId(Integer publishUserId);

    Integer countArticleVisitByUserId(Integer publishUserId);


}

